GUI Designer - Properties
This topic explains the properties appearing in the Properties Inspector that are proprietary to the GUI Designer.

Size Policy and Related Properties

There is a property concept in IDEA called Size Policy. It defines how a component's dimensions will be affected by resizing of its container. The property Horizontal Size Policy affects resizing behavior on the horizontal axis, and the Vertical Size Policy property affects the vertical axis. The following values are available for these properties:

canShrink The element size can be diminished (less than the preferred size) when the panel is resized.
canGrow The element size can be enlarged when the panel is resized.
wantGrow The element size is enlarged when the panel is resized. This flag takes precedence over the canGrow one.
fixed The element size does not change when the panel is resized. It appears when the three check boxes above are unselected.


The canShrink, canGrow and wantGrow flags can be used simultaneously.

Other properties

    binding:
    For a form, specifies the name of a class that contains the logic to make the form work.

    For a component, specifies the name of a field in the form's class to which the component is bound.

    If you bind the form to an existing class, then the drop-down list for this property shows the fields in the class when you go to bind a selected form component.

    If no class exists, you can still type in the name of the future class and IDEA will optionally create the class for you. If a class exists but has no field appropriate for a component you are binding, then you can type the name of the field and again, IDEA will offer the option to create the field in the bound class.

    Minimum/Preferred/Maximum Size:
    These properties are different from those used in the Java SDK. To be more specific, they are not actual properties but a part of constraints with which a component is added to a container. Such feature enables you to set a size value only for 1 dimension.

    For instance, if you set Preferred Size values as '200; -1' — it means that the component height will be calculated dynamically and the width value will be used as the preferred size. In effect it is like the Java statement:

       getPreferredSize().height();

    border:
    Defines how the component border and title will look. Applies to container type components only. There are two subproperties:
    • Type: specifies the bevel characteristics of the element border
    • Title: Applies Pops up a dialog where you can specify a string value, or the identifier of a resource.
    fill:
    Used to set how an element fills the containing cell.

    None Default size values are used for the component.
    Horizontal The component horizontal borders are drawn up to the cell edges.
    Vertical The component vertical borders are drawn up to the cell edges.
    Both The component horizontal and vertical borders are drawn up to the cell edges filling the entire cell.


    anchor:
    Determines the component position if it doesn't fill the entire cell and fill is not set to both. The element can be located at the cell's center, or adhered to one of its sides/angles designated with any of 8 compass directions... North, North-East, South, South-West, etc.

    rowSpan/columnSpan:
    Indicates how many cells (in a row or a column) the component occupies. The default value is "1" meaning that the component initially is located a single cell.


    When a property has a value of "-1" it means that the property value has not been defined specifically.

See also: